﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLBH.Model.Controller;
using QLBH.DataModel;
using QLBH.ModelInterface;

namespace QLBH.Category.Presenter
{
    public class QLMatHangPresenter
    {
        public QLMatHangPresenter()
        {

        }
        public List<IQLMatHangModel> GetDSMatHang()
        {
            try
            {
                List<IQLMatHangModel> result = new List<IQLMatHangModel>();
                var mh = MatHangController.GetInstance().GetAll();
                foreach (MATHANG entity in mh)
                {
                    IQLMatHangModel model = ModelFactory.ModelFactory.GetQLMatHangModelInstance();
                    model.InitFromEntity(entity);
                    result.Add(model);
                }
                return result;
            }
            catch (System.Exception ex)
            {
            	throw ex;
            }
           
        }
    }
}
